//
//  UIView+Style.h
//  ZhaoCaiMao
//
//  Created by xieyingze on 2017/3/13.
//  Copyright © 2017年 谢英泽. All rights reserved.
//


#import <UIKit/UIKit.h>
#import "AppHeader.h"

typedef NS_ENUM(NSInteger,kGradientDirection) {
    kGradientDirectionHorizontal = 0,
    kGradientDirectionVertical ,
    kGradientDirectionOpposite ,
};

@interface UIView (Style)

#pragma mark - Blur

- (void)setViewBlurWithRadius:(float)radius;

- (void)setViewBlur;

- (void)removeViewBlur;

#pragma mark - 圆角

- (void)setViewTopCornnerRadius:(CGRect)rect cornerRadius:(CGFloat)radius;

- (void)setViewBottomCornnerRadius:(CGRect)rect cornerRadius:(CGFloat)radius;

#pragma mark - 跟随键盘移动

- (void)setViewFollowKeyboard;

- (void)setViewRegistFollowKeyboard;

#pragma mark - 阴影

- (void)setViewShadow:(UIColor*)color offset:(CGSize)offset radius:(CGFloat)radius;

- (void)setViewShadow:(kGradientDirection)direction colors:(NSArray *)colors locations:(NSArray *)locations;

#pragma mark - 渐变色背景

- (void)setViewGradientColor:(NSArray *)colors locations:(NSArray *)locations;

- (void)setViewGradientColor:(NSArray *)colors frame:(CGRect)frame startPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint;

#pragma mark - 截图

- (UIImage *)getSnapshotImage;

- (UIImage *)getSnapshotImageWithSize:(CGSize)size;

- (UIImage *)getSnapshotImageAfterScreenUpdates:(BOOL)afterUpdates;

- (NSData *)getSnapshotPDF;

+ (UIImage *)locationImageWithImage:(UIImage *)image;

#pragma mrk - 尖角

- (void)setViewTopAngle:(CGFloat)offsetTop lineColor:(UIColor *)lineColor;

- (void)setViewTopAngle:(CGFloat)offsetTop offsetLeft:(CGFloat)offsetLeft lineColor:(UIColor *)lineColor angleColor:(UIColor *)angleColor;

@end
